#include <iostream>
#include <unordered_map>
#include <string>

std::unordered_map<std::string, double> price_map = {{"CNY", 100.},
                                                     {"fen", 1.},
                                                     {"HKD", 100. / 123. * 100.},
                                                     {"cents", 100. / 123.},
                                                     {"JPY", 100. / 1825. * 100.},
                                                     {"sen", 100. / 1825.},
                                                     {"EUR", 100. / 14. * 100.},
                                                     {"eurocents", 100. / 14.},
                                                     {"GBP", 100. / 12. * 100.},
                                                     {"pence", 100. / 12.}};
double parsePriceStr(std::string price_str)
{
    double price = 0;

    int i = 0;
    while (i < price_str.size())
    {
        int scalval = 0;
        while (price_str[i] <= '9' && price_str[i] >= '0')
        {
            scalval = scalval * 10 + (price_str[i] - '0');
            i++;
        }
        std::string unit;
        while ((price_str[i] <= 'z' && price_str[i] >= 'a') ||
               (price_str[i] <= 'Z' && price_str[i] >= 'A'))
        {
            unit.push_back(price_str[i]);
            i++;
        }

        price += scalval * price_map[unit];
    }

    return price;
}

int main()
{
    int num;
    std::cin >> num;
    std::cin.ignore();

    double price = 0;
    for (int i = 0; i < num; i++)
    {
        std::string price_str;
        std::cin >> price_str;
        price += parsePriceStr(price_str);
    }

    std::cout << (int)price << std::endl;

    return 0;
}